package com.tien.utils;

import org.springframework.security.core.context.SecurityContextHolder;

import com.tien.model.User;

/**
 * 
 * @author Tian
 * @Mail tianxin_star@163.com
 * @version date：Mar 12, 2012 4:02:56 PM
 * 
 */
public class SecurityUserUtil {

	/**
	 * Returns the current user
	 * 
	 * @return
	 */
	public static User getCurrentUser() {
		return (User) SecurityContextHolder.getContext().getAuthentication()
				.getPrincipal();
	}

}
